﻿using Mes.Domain.BoundedContext.Entities.Operations;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.Operations
{
    public class OperAttrEntityConfig : IEntityTypeConfiguration<OperAttr>
    {
        public void Configure(EntityTypeBuilder<OperAttr> builder)
        {
            builder.ToTable("oper_attr");
            builder.HasKey(e => new { e.Process_Id, e.Oper_Id, e.Attr_Id });
            builder.Property(e => e.Row_Id).IsRequired().UseIdentityColumn().HasIdentityOptions(startValue: 0, incrementBy: 1, minValue: 0);
        }
    }
}
